//Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
//Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
//Decompiler options: packimports(3) fieldsfirst ansi 
//Source File Name:   LocaleModel.java

package com.jycrm.presentation.core;

import java.util.*;
import org.apache.tapestry.form.IPropertySelectionModel;

public class LocaleModel
 implements IPropertySelectionModel
{

 private Locale locale;
 private List locales;

 public LocaleModel(Locale locale)
 {
     locales = new ArrayList();
     this.locale = locale;
 }

 public void add(Locale locale)
 {
     locales.add(locale);
 }

 private Locale get(int index)
 {
     return (Locale)locales.get(index);
 }

 public String getLabel(int index)
 {
     return get(index).getDisplayName(locale);
 }

 public int getOptionCount()
 {
     return locales.size();
 }

 public Object getOption(int index)
 {
     return locales.get(index);
 }

 public String getValue(int index)
 {
     return Integer.toString(index);
 }

 public Object translateValue(String value)
 {
     int index = Integer.parseInt(value);
     return locales.get(index);
 }
}
